
<?php

include 'GD_yanzheng.php';
$userId =   mysql_escape_string($_POST['username']);
$password =  mysql_escape_string($_POST['pwd']);

require_once ("../../config.inc.php");
	require_once ("../../include/mysql.inc.php");
	require_once ("../../include/admin.inc.php");

	$adminDao = new Admin();
	$flag =$adminDao->validLogin($userId, $password);
	echo $flag;
	if ($flag) {
		//session_save_path("D:\Apache2.2");
		session_start();
		$_SESSION['uid'] = $userId;
		echo '<script>location.href="../../admin/main.php";</script>';
	}
	else {
		echo '<script>location.href="../../admin/login.php";</script>';
	}
?>

